<template>
  <el-dialog v-model="dialogVisible" title="一键提醒" width="30%" :before-close="handleClose">
    <span>是否提醒该用户</span>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="onSubmit">确定</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
  import { reactive, ref } from 'vue'
  import bus from '@/utils/bus'
  import router from '@/router'
  import { messRemind, messInfoRemind } from '@/api/friendcircle.ts'
  import { ElMessage } from 'element-plus'

  let dialogVisible = ref(false)
  let userData = reactive({ id: '', work_user_id: '' })
  let dialogid = ref()
  let type = ref()
  // const remindInfoMess = (id: any) => {
  //   //dialogVisible.value = true
  //   userData = id
  //   type.value = 3
  //   onSubmit()
  // }
  const onSubmit = () => {
    if (type.value === 2) {
      messInfoRemind({ work_user_id: userData.work_user_id, send_msg_id: router.currentRoute.value.query.id, task_id:userData.id }).then((res) => {
        dialogVisible.value = false
      })
    }
    // if (type.value === 3) {
    //   messInfoRemind({ work_user_id: userData.work_user_id, send_moment_id: router.currentRoute.value.query.id, task_id:userData.id }).then((res) => {
    //     ElMessage({
    //       message: '提醒发送成功',
    //       type: 'success',
    //       duration: 2000
    //     })
    //   })
    // }
  }

  // bus.on('remindInfoMess', remindInfoMess)
</script>

<style lang="scss" scoped></style>
